package cn.itcast.erp.controller;

import cn.itcast.erp.annotation.CheckPower;
import cn.itcast.erp.entity.Storeoper;
import cn.itcast.erp.entity.utils.AjaxResult;
import cn.itcast.erp.service.CStoreoperService;
import org.springframework.format.datetime.DateFormatter;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 库存变动记录Controller类
 * @author 丛平
 * @date 2019/6/11
 */


@RestController
@RequestMapping("/storeoper")
public class CStoreoperController {

    @Resource(name="storeoperService")
    private CStoreoperService cStoreoperService;



    @CheckPower("库存变动记录")
    @RequestMapping(value = "/find",method = RequestMethod.POST)
    public AjaxResult findStoreoper(Storeoper storeoper){
        return this.cStoreoperService.findStoreoper (storeoper); }




    //时间转换器
    @InitBinder
    public void initBinder(WebDataBinder binder){
        binder.addCustomFormatter (new DateFormatter ("yyyy-MM-dd")); }
}



